package com.csu.backmanagesys.Service.impl;

import com.csu.backmanagesys.Domain.Category;
import com.csu.backmanagesys.Mapper.AccountMapper;
import com.csu.backmanagesys.Mapper.CategoryMapper;
import com.csu.backmanagesys.Service.AccountService;
import com.csu.backmanagesys.Service.CategoryService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CategoryServiceImpl implements CategoryService {
    @Resource
    private CategoryMapper categoryMapper;

    @Override
    public List<Category> selectCategory(){
        return categoryMapper.selectCategory();
    }

    @Override
    public List<Category> fuzzySelectCategory(String search) {
        return categoryMapper.fuzzySelectCategory(search);
    }

    ;

    @Override
    public void insertCategory(
            String categoryId,
            String name,
            String description
    ){
        categoryMapper.insertCategory(categoryId,name,description);
    };
    @Override
    public void deleteCategory(String categoryId){
        categoryMapper.deleteCategory(categoryId);
    };

    @Override
    public Category selectCategoryById(String id){ return categoryMapper.selectCategoryById(id);};

    @Override
    public void updateCategoryPic(String categoryId, String description) {
        categoryMapper.updateCategoryPic(categoryId,description);
    }

    @Override
    public void updateCategory(
            String categoryId,
            String name
    ){
        categoryMapper.updateCategory(categoryId,name);
    };
}
